package com.financing.wap.dao.impl;


import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;
import com.financing.wap.dto.FpClientOrderDTO;
import com.financing.wap.dao.IFpClientOrderDao;
import com.financing.wap.common.SqlName;
/**
 * fp_client_order  
 * 理财师店铺订单 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpClientOrderDao")
public class FpClientOrderDaoImpl extends BaseDaoImpl<FpClientOrderDTO, java.lang.Integer> implements IFpClientOrderDao {


	@Override
	public int insert(FpClientOrderDTO fpClientOrder) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.FpClientOrderSql.insert, fpClientOrder);
	}

	@Override
	public void update(FpClientOrderDTO fpClientOrder) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.FpClientOrderSql.update, fpClientOrder);
	}

	@Override
	public void updateForce(FpClientOrderDTO fpClientOrder) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.FpClientOrderSql.updateForce, fpClientOrder);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClientTemplate.delete(SqlName.FpClientOrderSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<FpClientOrderDTO> queryList(FpClientOrderDTO fpClientOrder) throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.FpClientOrderSql.queryList, fpClientOrder);
	}

	@Override
	public int queryListCount(FpClientOrderDTO fpClientOrder) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.FpClientOrderSql.queryListCount, fpClientOrder);
	}

	@Override
	public FpClientOrderDTO loadById(Integer id) throws SQLException {
		return  (FpClientOrderDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.FpClientOrderSql.loadById,id);
	}

	@Override
	public Class<FpClientOrderDTO> getEntityClass() {
		return FpClientOrderDTO.class;
	}

	@Override
	public Double orderCont(FpClientOrderDTO fpClientOrder) throws SQLException {
		// TODO Auto-generated method stub
		return (Double)this.getSqlMapClientTemplate().queryForObject(SqlName.FpClientOrderSql.orderCont,fpClientOrder);
	}
	
	@Override
	public Double orderContByUserId(FpClientOrderDTO fpClientOrder) throws SQLException {
		// TODO Auto-generated method stub
		return (Double)this.getSqlMapClientTemplate().queryForObject(SqlName.FpClientOrderSql.orderContByUserId,fpClientOrder);	
	}
	
	

	@Override
	public List<FpClientOrderDTO> queryListTimes(FpClientOrderDTO fpClientOrder) {
		return this.sqlMapClientTemplate.queryForList(SqlName.FpClientOrderSql.queryListTimes, fpClientOrder);
	}
 	
}
